home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / TRIMR.CC < prev    next >
Text File  |  1993-04-04  |  457b  |  19 lines

  1. trim_r(char *str)
  2. /* This will trim all blanks characters from the rigth side of the
  3.    string pointed to by *str.
  4. */
  5. {
  6.         char *s_str;
  7.         int str_len;
  8.         str_len=strlen(str);
  9.         if(!str_len) return(0);
  10.         s_str=str;
  11.         str=str + str_len - 1;
  12.         while((*str==' ') && str_len) {
  13.                 str--; str_len--;
  14.         }
  15.         *(str+1)=0x00;
  16.         str_len=strlen(s_str);
  17.         return(str_len);
  18. }
  19.